<!DOCTYPE html>
<!--解决idea thymeleaf 表达式模板报红波浪线-->
<!--suppress ALL -->
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8" />
    <title>srpingboot</title>
    <link rel="stylesheet" type="text/css" href="css/bootstrap.css">
<!--    <link rel="stylesheet" type="text/css" href="css/font-awesome.css">-->
    <link rel="stylesheet" href="https://cdn.staticfile.org/font-awesome/4.7.0/css/font-awesome.css">

    <style>
        table{
            width:100%;
            border-collapse: collapse;
        }
        table td{
            height:35px;
            line-height: 35px;
            text-align: center;
            border:1px solid #ddd;
        }
        table th {
            height:40px;
            line-height: 40px;
            text-align: center;
            border:1px solid #ddd;
            background:#d3d1d2;
        }
        table tr:nth-child(odd){
            background:#fff;
        }
        table tr:nth-child(even){
            background:#ddd;
        }
        table tr:hover{
            background:#007bff;
        }
        .inputStyle{
            width:200px;
            height:35px;
            padding:3px;
        }
        .inputrightStyle{
            width:300px;
            height:35px;
            padding:3px;
        }
        .btn{
            padding:5px 20px;
            text-align: center;
            margin-right:5px;
            background:#ddd;
        }
        .link{
            color:#80bdff;
            cursor: pointer;
        }

        .pagination {
            list-style: none;
            margin: 0;
            padding: 0;
            display: flex;
        }

        .pagination li {
            margin: 0 1px;
        }

        .pagination a {
            display: block;
            padding: .5em 1em;
            border: 1px solid #999;
            border-radius: .2em;
            text-decoration: none;
        }

        .pagination a[aria-current="page"] {
            background-color: #333;
            color: #fff;
        }
        .xuanzhong {
            font-weight: bold;
            background: #ddd;
            display: block;
            padding: .5em 1em;
            border: 1px solid #999;
            border-radius: .2em;
            text-decoration: none;
        }
    </style>
</head>
<body>
<!-- 属性替换，其他属性同理 -->
<h1 th:text="${newText}">Hello World</h1>
<!--
    设置多个attr
    th:attr="id=${user.id},data-xxx=${user.xxx},data-yyy=${user.yyy}"

    片段的使用、传值和调用
    <div th:fragment="common(text1,text2)">
        ...
    </div>
    th:insert 是最简单的：它只是插入指定的片段作为其主机标签的主体。
    <div th:insert="base ::common(${text1},${text2})"></div>

    th:replace实际上用指定的片段替换它的主机标签。
    <div th:replace="base ::common(${text1},${text2})"></div>　　　　　　　　　三目表达式：　　　　　<h3 th:text="${loginUser != null} ? ${loginUser.username} : '请登录'"></h3>　
-->

<!-- if-else --><!--
<h3 th:if="${loginUser} ne null" th:text="${loginUser.username}"></h3>
<h3 th:unless="${loginUser} ne null">请登录</h3>

&lt;!&ndash; switch &ndash;&gt;
<div th:switch="${gender}">
    <p th:case="'1'">男</p>
    <p th:case="'0'">女</p>
    &lt;!&ndash; th:case="*"  类似switch中的default &ndash;&gt;
    <p th:case="*">其他</p>
</div>-->
<div style="text-align: center;padding:15px;margin-bottom:30px;">
    <div style="width:48%;float:left;border:1px solid #333;text-align: center;padding:15px;margin-bottom:30px;">
<!--        公司代码&nbsp;<input class="inputStyle" id="segNo">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-->
        订单号&nbsp;<input class="inputStyle" id="productionOrderCode">
<!--        资源号&nbsp;<input class="inputStyle" id="fProductId">-->
<!--        捆包号&nbsp;<input class="inputStyle" id="fPackId">-->
        <p style="text-align: center;margin-top:20px;">
            <button class="btn" onclick="queryGmscInit()">查询</button>
<!--            <button class="btn" onclick="addInit()">新增</button>-->
        </p>
    </div>
    <div style="width:48%;float:right;border:1px solid #333;text-align: center;padding:15px;margin-bottom:30px;">

    捆包号&nbsp;<input class="inputrightStyle" id="queryPackId">
    <p style="text-align: center;margin-top:20px;">
        <button class="btn" onclick="queryInit()">本地查询</button>
        <button class="btn" onclick="addInit()">新增</button>
    </p>
    </div>
</div>
<!-- 　　　　each　　　　其中，iterStat参数为状态变量，常用的属性有　　　　index 迭代下标，从0开始　　　　count 迭代下标，从1开始　　　　size 迭代元素的总量　　　　current 当前元素
　　 -->
<table>
    <thead>
    <tr>
        <th>捆包号</th>
        <th>卷内径</th>
        <th>卷外径</th>
        <th>卷宽度</th>
        <th>十字臂号</th>
        <th>臂上序号</th>
        <th>臂号加序号</th>
        <th>堆垛方式</th>
        <th>捆包卷数</th>
        <th>堆垛托盘号</th>
        <th>钢厂资源号</th>
        <th>标准</th>
        <th>规格</th>
        <th>品种</th>
        <th>品名</th>
        <th>牌号</th>
        <th>钢卷号</th>
        <th>件数</th>
        <th>机组</th>
        <th>质量等级</th>
        <th>单位编码</th>
        <th>单位名称</th>
        <th>单位备注</th>
        <th>日期</th>
        <th>时间</th>
        <th>并包号</th>
        <th>炉号</th>
        <th>检查员</th>
        <th>零件号</th>
        <th>零件名称</th>
        <th>母卷号</th>
        <th>毛重增加</th>
        <th>净重</th>
        <th>毛重</th>

        <th>操作</th>
    </tr>
    </thead>
    <tbody>
    <tr th:each="product,iterStat : ${pager.list}">
        <td th:text="${product.packId}"></td>
        <td th:text="${product.innerDiameter}"></td>
        <td th:text="${product.outDiameter}"></td>
        <td th:text="${product.outWidth}"></td>
        <td th:text="${product.armNum}"></td>
        <td th:text="${product.serialNum}"></td>
        <td th:text="${product.armAndserialNum}"></td>
        <td th:text="${product.stacking}"></td>
        <td th:text="${product.putinQty}"></td>
        <td th:text="${product.stackingNo}"></td>
        <td th:text="${product.factoryProductid}"></td>
        <td th:text="${product.standard}"></td>
        <td th:text="${product.spec}"></td>
        <td th:text="${product.productTypeId}"></td>
        <td th:text="${product.productTypeName}"></td>
        <td th:text="${product.shopsign}"></td>
        <td th:text="${product.coilNo}"></td>
        <td th:text="${product.quantity}"></td>
        <td th:text="${product.machineId}"></td>
        <td th:text="${product.qualityGradeName}"></td>
        <td th:text="${product.consigneeId}"></td>
        <td th:text="${product.consigneeName}"></td>
        <td th:text="${product.consigneeRemark}"></td>
        <td th:text="${product.modiDate}"></td>
        <td th:text="${product.modiTime}"></td>
        <td th:text="${product.unitedPackid}"></td>
        <td th:text="${product.stoveNum}"></td>
        <td th:text="${product.modiPerson}"></td>
        <td th:text="${product.partId}"></td>
        <td th:text="${product.partName}"></td>
        <td th:text="${product.mwrapid}"></td>
        <td th:text="${product.grossWeightAdd}"></td>
        <td th:text="${product.putinWeight}"></td>
        <td th:text="${product.grossWeight}"></td>

        <td>
            <a class="link" th:data-id="${product.packId}" style="color:#80bdff;" onclick="updateInit(this.getAttribute('data-id'))" >修改</a>
            <!--<a class="link">删除</a>-->
        </td>
    </tr>
    </tbody>
</table>

<!--显示分页信息-->
<div class="modal-footer no-margin-top">
    <div class="col-md-6">
        当前第 [[${pager.pageNum}]]页,共 [[${pager.pages}]] 页.一共 [[${pager.total}]] 条记录
    </div>


    <ul class="pagination pull-right no-margin">
        <li th:if="${pager.hasPreviousPage}">
            <a th:href="'/index?pageNo=1'">首页</a>
        </li>

        <li class="prev" th:if="${pager.hasPreviousPage}">
            <a th:href="'/index?pageNo='+${pager.prePage}">
                <i class="ace-icon fa fa-angle-double-left"></i>
            </a>
        </li>
        <!--遍历条数-->
        <li th:each="nav:${pager.navigatepageNums}">
            <a th:href="'/index?pageNo='+${nav}" th:text="${nav}" th:if="${nav != pager.pageNum}"></a>
            <span th:class="xuanzhong" th:if="${nav == pager.pageNum}" th:text="${nav}" ></span>
        </li>

        <li class="next" th:if="${pager.hasNextPage}">
            <a th:href="'/index?pageNo='+${pager.nextPage}">
                <i class="ace-icon fa fa-angle-double-right"></i>
            </a>
        </li>

        <li>
            <a th:href="'/index?pageNo='+${pager.pages}">尾页</a>
        </li>
    </ul>
</div>


<div class="modal fade bs-example-modal-lg" id="newAddModal">
    <div class="modal-dialog modal-lg">
        <div class="modal-content" >
            <div class="modal-header" >
                <h4 class="modal-title">新增</h4>
            </div>
            <div class="modal-body">
                <div class="row">
                    <div class="col-md-4">
                        <div class="input-group">
                            <span class="input-group-text" >捆包号</span>
                            <input type="text" class="form-control" BackColor="#669900" aria-describedby="name1" id="packIdAdd" name="packIdAdd">
                        </div>
                    </div>
                    <div class="col-md-4">
                        <div class="input-group">
                            <span class="input-group-text" >堆垛区</span>
                            <input type="text" class="form-control" aria-describedby="name1" id="stackingAdd">
                        </div>
                    </div>
                    <div class="col-md-4">
                        <div class="input-group">
                            <span class="input-group-text" >堆垛托盘号</span>
                            <input type="text" class="form-control" aria-describedby="name1" id="stackingNoAdd" >
                        </div>
                    </div>
                </div>
            </div>
            <div class="modal-body">
                <div class="row">
                    <div class="col-md-4">
                        <div class="input-group">
                            <span class="input-group-text" >捆包卷数</span>
                            <input type="text" class="form-control" aria-describedby="name1" id="putinQtyAdd" >
                        </div>
                    </div>
                    <div class="col-md-4">
                        <div class="input-group">
                            <span class="input-group-text" >卷宽度</span>
                            <input type="text" class="form-control" aria-describedby="name1" id="outWidthAdd" >
                        </div>
                    </div>
                    <div class="col-md-4">
                        <div class="input-group">
                            <span class="input-group-text" >卷内径</span>
                            <input type="text" class="form-control" aria-describedby="name1" id="innerDiameterAdd">
                        </div>
                    </div>
                </div>
            </div>
            <div class="modal-body">
                <div class="row">
                    <div class="col-md-4">
                        <div class="input-group">
                            <span class="input-group-text" >十字臂号</span>
<!--                            <input type="text" class="form-control" aria-describedby="name1" id="armNumAdd" >-->
                            <select name="armNumAdd" id="armNumAdd" class="form-control" onchange="funcAdd()" >
                                <option value="00">请选择</option>
                                <option value="01">01</option>
                                <option valeu="02">02</option>
                                <option value="03">03</option>
                                <option value="04">04</option>
                            </select>
                        </div>
                    </div>
                    <div class="col-md-4">
                        <div class="input-group">
                            <span class="input-group-text" >臂上序号</span>
<!--                            <input type="text" class="form-control" aria-describedby="name1" id="serialNumAdd" >-->
                            <select name="serialNumAdd" id="serialNumAdd" class="form-control" >
<!--                                <option value="01">01</option>-->
<!--                                <option valeu="02">02</option>-->
<!--                                <option value="03">03</option>-->
<!--                                <option value="04">04</option>-->
<!--                                <option value="05">05</option>-->
<!--                                <option value="06">06</option>-->
<!--                                <option value="07">07</option>-->
<!--                                <option value="08">08</option>-->
<!--                                <option value="09">09</option>-->
<!--                                <option value="10">10</option>-->
<!--                                <option value="11">11</option>-->
<!--                                <option value="12">12</option>-->
                            </select>
                        </div>
                    </div>
                    <div class="col-md-4">
                        <div class="input-group">
                            <span class="input-group-text" >臂号加序号</span>
                            <input type="text" class="form-control" aria-describedby="name1" id="armAndserialNumAdd" readonly="readonly">
                        </div>
                    </div>
                </div>
            </div>
            <div class="modal-body">
                <div class="row">
                </div>
            </div>
            <div class="modal-body">
                <div class="row">
                    <div class="col-md-4">
                        <div class="input-group">
                            <span class="input-group-text" >卷外径</span>
                            <input type="text" class="form-control" aria-describedby="name1" id="outDiameterAdd">
                        </div>
                    </div>
                    <div class="col-md-4">
                        <div class="input-group">
                            <span class="input-group-text" >钢厂资源号</span>
                            <input type="text" class="form-control" aria-describedby="name1" id="factoryProductidAdd">
                        </div>
                    </div>
                    <div class="col-md-4">
                        <div class="input-group">
                            <span class="input-group-text" >标准</span>
                            <input type="text" class="form-control" aria-describedby="name1" id="standardAdd" >
                        </div>
                    </div>
                </div>
            </div>
            <div class="modal-body">
                <div class="row">
                    <div class="col-md-4">
                        <div class="input-group">
                            <span class="input-group-text" >规格</span>
                            <input type="text" class="form-control" aria-describedby="name1" id="specAdd" >
                        </div>
                    </div>
                    <div class="col-md-4">
                        <div class="input-group">
                            <span class="input-group-text" >品种</span>
                            <input type="text" class="form-control" aria-describedby="name1" id="productTypeIdAdd">
                        </div>
                    </div>
                    <div class="col-md-4">
                        <div class="input-group">
                            <span class="input-group-text" >品名</span>
                            <input type="text" class="form-control" aria-describedby="name1" id="productTypeNameAdd">
                        </div>
                    </div>
                </div>
            </div>
            <div class="modal-body">
                <div class="row">
                    <div class="col-md-4">
                        <div class="input-group">
                            <span class="input-group-text" >牌号</span>
                            <input type="text" class="form-control" aria-describedby="name1" id="shopsignAdd" >
                        </div>
                    </div>
                    <div class="col-md-4">
                        <div class="input-group">
                            <span class="input-group-text" >钢卷号</span>
                            <input type="text" class="form-control" aria-describedby="name1" id="coilNoAdd">
                        </div>
                    </div>
                    <div class="col-md-4">
                        <div class="input-group">
                            <span class="input-group-text" >件数</span>
                            <input type="text" class="form-control" aria-describedby="name1" id="quantityAdd">
                        </div>
                    </div>
                </div>
            </div>
            <div class="modal-body">
                <div class="row">
                    <div class="col-md-4">
                        <div class="input-group">
                            <span class="input-group-text" >机组</span>
                            <input type="text" class="form-control" aria-describedby="name1" id="machineIdAdd">
                        </div>
                    </div>
                    <div class="col-md-4">
                        <div class="input-group">
                            <span class="input-group-text" >质量等级</span>
                            <input type="text" class="form-control" aria-describedby="name1" id="qualityGradeNameAdd" >
                        </div>
                    </div>
                    <div class="col-md-4">
                        <div class="input-group">
                            <span class="input-group-text" >收货单位编码</span>
                            <input type="text" class="form-control" aria-describedby="name1" id="consigneeIdAdd">
                        </div>
                    </div>
                </div>
            </div>
            <div class="modal-body">
                <div class="row">
                    <div class="col-md-4">
                        <div class="input-group">
                            <span class="input-group-text" >收货单位名称</span>
                            <input type="text" class="form-control" aria-describedby="name1" id="consigneeNameAdd">
                        </div>
                    </div>
                    <div class="col-md-4">
                        <div class="input-group">
                            <span class="input-group-text" >收货单位备注</span>
                            <input type="text" class="form-control" aria-describedby="name1" id="consigneeRemarkAdd" >
                        </div>
                    </div>
                    <div class="col-md-4">
                        <div class="input-group">
                            <span class="input-group-text" >日期</span>
                            <input type="text" class="form-control" aria-describedby="name1" id="modiDateAdd">
                        </div>
                    </div>
                </div>
            </div>
            <div class="modal-body">
                <div class="row">
                    <div class="col-md-4">
                        <div class="input-group">
                            <span class="input-group-text" >时间</span>
                            <input type="text" class="form-control" aria-describedby="name1" id="modiTimeAdd">
                        </div>
                    </div>
                    <div class="col-md-4">
                        <div class="input-group">
                            <span class="input-group-text" >并包号</span>
                            <input type="text" class="form-control" aria-describedby="name1" id="unitedPackidAdd">
                        </div>
                    </div>
                    <div class="col-md-4">
                        <div class="input-group">
                            <span class="input-group-text" >炉号</span>
                            <input type="text" class="form-control" aria-describedby="name1" id="stoveNumAdd" >
                        </div>
                    </div>
                </div>
            </div>
            <div class="modal-body">
                <div class="row">
                    <div class="col-md-4">
                        <div class="input-group">
                            <span class="input-group-text" >检查员</span>
                            <input type="text" class="form-control" aria-describedby="name1" id="modiPersonAdd" >
                        </div>
                    </div>
                    <div class="col-md-4">
                        <div class="input-group">
                            <span class="input-group-text" >零件号</span>
                            <input type="text" class="form-control" aria-describedby="name1" id="partIdAdd">
                        </div>
                    </div>
                    <div class="col-md-4">
                        <div class="input-group">
                            <span class="input-group-text" >零件名称</span>
                            <input type="text" class="form-control" aria-describedby="name1" id="partNameAdd">
                        </div>
                    </div>
                </div>
            </div>
            <div class="modal-body">
                <div class="row">
                    <div class="col-md-4">
                        <div class="input-group">
                            <span class="input-group-text" >母卷号</span>
                            <input type="text" class="form-control" aria-describedby="name1" id="mwrapidAdd">
                        </div>
                    </div>
                    <div class="col-md-4">
                        <div class="input-group">
                            <span class="input-group-text" >毛重增加</span>
                            <input type="text" class="form-control" aria-describedby="name1" id="grossWeightAddAdd">
                        </div>
                    </div>
                    <div class="col-md-4">
                        <div class="input-group">
                            <span class="input-group-text" >净重</span>
                            <input type="text" class="form-control" aria-describedby="name1" id="putinWeightAdd">
                        </div>
                    </div>
                </div>
            </div>
            <div class="modal-body">
                <div class="row">
                    <div class="col-md-4">
                        <div class="input-group">
                            <span class="input-group-text" >毛重</span>
                            <input type="text" class="form-control" aria-describedby="name1" id="grossWeightForAdd">
                        </div>
                    </div>
                </div>
            </div>
            <div class="modal-footer">
                <button data-dismiss="modal" type="button" class="btn-primary" href="javascript:void(0)" onclick="insertProduct()">确定</button>
                <button data-dismiss="modal" type="button" class="btn-default">取消</button>
            </div>
        </div>
    </div>
</div>

<div class="modal fade bs-example-modal-lg" id="updateModal">
    <div class="modal-dialog modal-lg">
        <div class="modal-content" >
            <div class="modal-header" >
                <h4 class="modal-title">修改</h4>
            </div>
            <div class="modal-body">
                <div class="row">
                    <div class="col-md-4">
                        <div class="input-group">
                            <span class="input-group-text" >捆包号</span>
                            <input type="text" class="form-control" aria-describedby="name1" id="packId" name="packId">
                        </div>
                    </div>
                    <div class="col-md-4">
                        <div class="input-group">
                            <span class="input-group-text" >堆垛区</span>
                            <input type="text" class="form-control" aria-describedby="name1" id="stacking">
                        </div>
                    </div>
                    <div class="col-md-4">
                        <div class="input-group">
                            <span class="input-group-text" >堆垛托盘号</span>
                            <input type="text" class="form-control" aria-describedby="name1" id="stackingNo" >
                        </div>
                    </div>
                </div>
            </div>
            <div class="modal-body">
                <div class="row">
                    <div class="col-md-4">
                        <div class="input-group">
                            <span class="input-group-text" >捆包卷数</span>
                            <input type="text" class="form-control" aria-describedby="name1" id="putinQty" >
                        </div>
                    </div>
                    <div class="col-md-4">
                        <div class="input-group">
                            <span class="input-group-text" >卷宽度</span>
                            <input type="text" class="form-control" aria-describedby="name1" id="outWidth" >
                        </div>
                    </div>
                    <div class="col-md-4">
                        <div class="input-group">
                            <span class="input-group-text" >卷内径</span>
                            <input type="text" class="form-control" aria-describedby="name1" id="innerDiameter">
                        </div>
                    </div>
                </div>
            </div>
            <div class="modal-body">
                <div class="row">

                    <div class="col-md-4">
                        <div class="input-group">
                            <span class="input-group-text" >十字臂号</span>
<!--                            <input type="text" class="form-control" aria-describedby="name1" id="armNum" >-->
                            <select name="armNum" id="armNum" class="form-control" onchange="func()" >
                                <option value="00">请选择</option>
                                <option value="01">01</option>
                                <option value="02">02</option>
                                <option value="03">03</option>
                                <option value="04">04</option>
                            </select>
                        </div>
                    </div>

                    <div class="col-md-4">
                        <div class="input-group">
                            <span class="input-group-text" >臂上序号</span>
<!--                            <input type="text" class="form-control" aria-describedby="name1" id="serialNum" >-->
                            <select name="serialNum" id="serialNum" class="form-control" >
<!--                                <option value="01">01</option>-->
<!--                                <option value="02">02</option>-->
<!--                                <option value="03">03</option>-->
<!--                                <option value="04">04</option>-->
<!--                                <option value="05">05</option>-->
<!--                                <option value="06">06</option>-->
<!--                                <option value="07">07</option>-->
<!--                                <option value="08">08</option>-->
<!--                                <option value="09">09</option>-->
<!--                                <option value="10">10</option>-->
<!--                                <option value="11">11</option>-->
<!--                                <option value="12">12</option>-->
                            </select>
                        </div>
                    </div>
                    <div class="col-md-4">
                        <div class="input-group">
                            <span class="input-group-text" >臂号加序号</span>
                            <input type="text" class="form-control" aria-describedby="name1" id="armAndserialNum" readonly="readonly">
                        </div>
                    </div>
                </div>
            </div>
            <div class="modal-body">
                <div class="row">
                </div>
            </div>
            <div class="modal-body">
                <div class="row">
                    <div class="col-md-4">
                        <div class="input-group">
                            <span class="input-group-text" >卷外径</span>
                            <input type="text" class="form-control" aria-describedby="name1" id="outDiameter">
                        </div>
                    </div>
                    <div class="col-md-4">
                        <div class="input-group">
                            <span class="input-group-text" >钢厂资源号</span>
                            <input type="text" class="form-control" aria-describedby="name1" id="factoryProductid">
                        </div>
                    </div>
                    <div class="col-md-4">
                        <div class="input-group">
                            <span class="input-group-text" >标准</span>
                            <input type="text" class="form-control" aria-describedby="name1" id="standard" >
                        </div>
                    </div>
                </div>
            </div>
            <div class="modal-body">
                <div class="row">
                    <div class="col-md-4">
                        <div class="input-group">
                            <span class="input-group-text" >规格</span>
                            <input type="text" class="form-control" aria-describedby="name1" id="spec" >
                        </div>
                    </div>
                    <div class="col-md-4">
                        <div class="input-group">
                            <span class="input-group-text" >品种</span>
                            <input type="text" class="form-control" aria-describedby="name1" id="productTypeId">
                        </div>
                    </div>
                    <div class="col-md-4">
                        <div class="input-group">
                            <span class="input-group-text" >品名</span>
                            <input type="text" class="form-control" aria-describedby="name1" id="productTypeName">
                        </div>
                    </div>
                </div>
            </div>
            <div class="modal-body">
                <div class="row">
                    <div class="col-md-4">
                        <div class="input-group">
                            <span class="input-group-text" >牌号</span>
                            <input type="text" class="form-control" aria-describedby="name1" id="shopsign" >
                        </div>
                    </div>
                    <div class="col-md-4">
                        <div class="input-group">
                            <span class="input-group-text" >钢卷号</span>
                            <input type="text" class="form-control" aria-describedby="name1" id="coilNo">
                        </div>
                    </div>
                    <div class="col-md-4">
                        <div class="input-group">
                            <span class="input-group-text" >件数</span>
                            <input type="text" class="form-control" aria-describedby="name1" id="quantity">
                        </div>
                    </div>
                </div>
            </div>
            <div class="modal-body">
                <div class="row">
                    <div class="col-md-4">
                        <div class="input-group">
                            <span class="input-group-text" >机组</span>
                            <input type="text" class="form-control" aria-describedby="name1" id="machineId">
                        </div>
                    </div>
                    <div class="col-md-4">
                        <div class="input-group">
                            <span class="input-group-text" >质量等级</span>
                            <input type="text" class="form-control" aria-describedby="name1" id="qualityGradeName" >
                        </div>
                    </div>
                    <div class="col-md-4">
                        <div class="input-group">
                            <span class="input-group-text" >收货单位编码</span>
                            <input type="text" class="form-control" aria-describedby="name1" id="consigneeId">
                        </div>
                    </div>
                </div>
            </div>
            <div class="modal-body">
                <div class="row">
                    <div class="col-md-4">
                        <div class="input-group">
                            <span class="input-group-text" >收货单位名称</span>
                            <input type="text" class="form-control" aria-describedby="name1" id="consigneeName">
                        </div>
                    </div>
                    <div class="col-md-4">
                        <div class="input-group">
                            <span class="input-group-text" >收货单位备注</span>
                            <input type="text" class="form-control" aria-describedby="name1" id="consigneeRemark" >
                        </div>
                    </div>
                    <div class="col-md-4">
                        <div class="input-group">
                            <span class="input-group-text" >日期</span>
                            <input type="text" class="form-control" aria-describedby="name1" id="modiDate">
                        </div>
                    </div>
                </div>
            </div>
            <div class="modal-body">
                <div class="row">
                    <div class="col-md-4">
                        <div class="input-group">
                            <span class="input-group-text" >时间</span>
                            <input type="text" class="form-control" aria-describedby="name1" id="modiTime">
                        </div>
                    </div>
                    <div class="col-md-4">
                        <div class="input-group">
                            <span class="input-group-text" >并包号</span>
                            <input type="text" class="form-control" aria-describedby="name1" id="unitedPackid">
                        </div>
                    </div>
                    <div class="col-md-4">
                        <div class="input-group">
                            <span class="input-group-text" >炉号</span>
                            <input type="text" class="form-control" aria-describedby="name1" id="stoveNum" >
                        </div>
                    </div>
                </div>
            </div>
            <div class="modal-body">
                <div class="row">
                    <div class="col-md-4">
                        <div class="input-group">
                            <span class="input-group-text" >检查员</span>
                            <input type="text" class="form-control" aria-describedby="name1" id="modiPerson" >
                        </div>
                    </div>
                    <div class="col-md-4">
                        <div class="input-group">
                            <span class="input-group-text" >零件号</span>
                            <input type="text" class="form-control" aria-describedby="name1" id="partId">
                        </div>
                    </div>
                    <div class="col-md-4">
                        <div class="input-group">
                            <span class="input-group-text" >零件名称</span>
                            <input type="text" class="form-control" aria-describedby="name1" id="partName">
                        </div>
                    </div>
                </div>
            </div>
            <div class="modal-body">
                <div class="row">
                    <div class="col-md-4">
                        <div class="input-group">
                            <span class="input-group-text" >母卷号</span>
                            <input type="text" class="form-control" aria-describedby="name1" id="mwrapid">
                        </div>
                    </div>
                    <div class="col-md-4">
                        <div class="input-group">
                            <span class="input-group-text" >毛重增加</span>
                            <input type="text" class="form-control" aria-describedby="name1" id="grossWeightAdd">
                        </div>
                    </div>
                    <div class="col-md-4">
                        <div class="input-group">
                            <span class="input-group-text" >净重</span>
                            <input type="text" class="form-control" aria-describedby="name1" id="putinWeight">
                        </div>
                    </div>
                </div>
            </div>
            <div class="modal-body">
                <div class="row">
                    <div class="col-md-4">
                        <div class="input-group">
                            <span class="input-group-text" >毛重</span>
                            <input type="text" class="form-control" aria-describedby="name1" id="grossWeight">
                        </div>
                    </div>
                </div>
            </div>
            <div class="modal-footer">
                <button data-dismiss="modal" type="button" class="btn-primary" href="javascript:void(0)" onclick="updateProduct('${product.partId}')">修改</button>
                <button data-dismiss="modal" type="button" class="btn-default">取消</button>
            </div>
        </div>
    </div>
</div>
<script type="text/javascript" src="js/jquery-3.5.1.min.js"></script>
<script type="text/javascript" src="js/bootstrap.bundle.js"></script>
<script>

</script>
<script type="text/javascript">

    document.getElementById('packIdAdd').style.background = '#00FF00';
    document.getElementById('packId').style.background = '#00FF00';
    document.getElementById('stackingAdd').style.background = '#00FF00';
    document.getElementById('stacking').style.background = '#00FF00';
    document.getElementById('stackingNoAdd').style.background = '#00FF00';
    document.getElementById('stackingNo').style.background = '#00FF00';
    document.getElementById('putinQtyAdd').style.background = '#00FF00';
    document.getElementById('putinQty').style.background = '#00FF00';
    document.getElementById('outWidthAdd').style.background = '#00FF00';
    document.getElementById('outWidth').style.background = '#00FF00';
    document.getElementById('innerDiameterAdd').style.background = '#00FF00';
    document.getElementById('innerDiameter').style.background = '#00FF00';
    document.getElementById('armNumAdd').style.background = '#00FF00';
    document.getElementById('armNum').style.background = '#00FF00';
    document.getElementById('serialNumAdd').style.background = '#00FF00';
    document.getElementById('serialNum').style.background = '#00FF00';


    function queryInit() {
        var queryPackId  = $("#queryPackId").val();
        location.href="/index?packId="+queryPackId
    }

    function queryGmscInit() {
        var segNo = $("#segNo").val();
        var productionOrderCode = $("#productionOrderCode").val();
        var fProductId = $("#fProductId").val();
        var fPackId = $("#fPackId").val();
        $.ajax({
            url: '/queryAndInsertData',
            // type:'post',
            // contentType: "application/json;charset=utf-8",
            dataType: "json",
            data : {"segNo":segNo, "productionOrderCode":productionOrderCode, "fProductId":fProductId, "fPackId":fPackId},
            // data : {segNo:segNo, productionOrderCode:productionOrderCode, fProductId:fProductId, fPackId:fPackId},
            success:function (result) {
                console.log(result);
                if (result.resultCode == 200){
                    alert(result.resultMsg);

                }else {
                    alert("获取失败！")
                }
                location.href="/index";
            }
        });

    }

    function  del(id) {
        alert(id);
    }

    function funcAdd(){
        //获取被选中的option标签
        var armNum = $('#armNumAdd  option:selected').val();
        $.ajax({
            url: '/getSerialNum',
            dataType: "json",
            data : {"armNum":armNum},
            success:function (result) {
                var select=$("#serialNumAdd");
                $('#serialNumAdd option').remove();
                for(var i=0;i<result.length;i++){
                    console.log(result[i]);
                    var option=document.createElement("option");
                    option.setAttribute("type","option");
                    option.setAttribute("id",result[i]);
                    option.setAttribute("value", result[i]);
                    option.appendChild(document.createTextNode(result[i]));
                    select.append(option);
                }
            }
        });
    }

    function func(){
        //获取被选中的option标签
        var armNum = $('#armNum  option:selected').val();
        var packId = $("#packId").val();
        $.ajax({
            url: '/getSerialNum',
            dataType: "json",
            data : {"armNum":armNum, "packId":packId},
            success:function (result) {
                var select=$("#serialNum");
                $('#serialNum option').remove();
                for(var i=0;i<result.length;i++){
                    console.log(result[i]);
                    var option=document.createElement("option");
                    option.setAttribute("type","option");
                    option.setAttribute("id",result[i]);
                    option.setAttribute("value", result[i]);
                    option.appendChild(document.createTextNode(result[i]));
                    select.append(option);
                }
            }
        });
    }

    function addInit() {
        // $.ajax({
        //     url: '/getArmNum',
        //     dataType: "json",
        //     success:function (result) {
        //         var select=$("#armNumAdd");
        //         for(var i=0;i<result.length;i++){
        //             var option=document.createElement("option");
        //             option.setAttribute("type","option");
        //             option.setAttribute("id",result[i]);
        //             option.setAttribute("value", result[i]);
        //             option.appendChild(document.createTextNode(result[i]));
        //             select.append(option);
        //         }
        //     }
        // });
        $('#newAddModal').modal('show');
    }

    function updateInit(packid) {
        // console.log(packid);
        // var partId = $("#partId").val();
        // $.ajax({
        //     url: '/getArmNum',
        //     dataType: "json",
        //     success:function (result) {
        //
        //         var select=$("#armNum");
        //         for(var i=0;i<result.length;i++){
        //             console.log(result[i]);
        //             var option=document.createElement("option");
        //             option.setAttribute("type","option");
        //             option.setAttribute("id",result[i]);
        //             option.setAttribute("value", result[i]);
        //             option.appendChild(document.createTextNode(result[i]));
        //             select.append(option);
        //         }
        //     }
        // });
        $('#updateModal').modal('show');
        $.ajax({
            url: '/querypartpackinfo',
            data : {"packid":packid},
            dataType: "json",
            success:function (result) {
                // console.log(result);
                var data = result.list;
                if (data != null && data.length > 0){
                    for (var i=0;i<data.length;i++){
                        // console.log(data[i].packId);
                        var armNum = data[i].armNum;
                        var packId = data[i].packId;
                        $.ajax({
                            url: '/getSerialNum',
                            dataType: "json",
                            async:false,
                            data : { "packId":packId, "armNum":armNum,},
                            success:function (result) {
                                var select=$("#serialNum");
                                $('#serialNum option').remove();
                                for(var i=0;i<result.length;i++){
                                    console.log(result[i]);
                                    var option=document.createElement("option");
                                    option.setAttribute("type","option");
                                    option.setAttribute("id",result[i]);
                                    option.setAttribute("value", result[i]);
                                    option.appendChild(document.createTextNode(result[i]));
                                    select.append(option);
                                }
                            }
                        });

                        $('#packId').val(data[i].packId);
                        $('#innerDiameter').val(data[i].innerDiameter);
                        $('#outDiameter').val(data[i].outDiameter);
                        $('#outWidth').val(data[i].outWidth);
                        $('#stacking').val(data[i].stacking);
                        $('#putinQty').val(data[i].putinQty);
                        $('#stackingNo').val(data[i].stackingNo);
                        $('#factoryProductid').val(data[i].factoryProductid);
                        $('#standard').val(data[i].standard);
                        $('#spec').val(data[i].spec);
                        $('#productTypeId').val(data[i].productTypeId);
                        $('#productTypeName').val(data[i].productTypeName);
                        $('#shopsign').val(data[i].shopsign);
                        $('#coilNo').val(data[i].coilNo);
                        $('#quantity').val(data[i].quantity);
                        $('#machineId').val(data[i].machineId);
                        $('#qualityGradeName').val(data[i].qualityGradeName);
                        $('#consigneeId').val(data[i].consigneeId);
                        $('#consigneeName').val(data[i].consigneeName);
                        $('#consigneeRemark').val(data[i].consigneeRemark);
                        $('#modiDate').val(data[i].modiDate);
                        $('#modiTime').val(data[i].modiTime);
                        $('#unitedPackid').val(data[i].unitedPackid);
                        $('#stoveNum').val(data[i].stoveNum);
                        $('#modiPerson').val(data[i].modiPerson);
                        $('#partId').val(data[i].partId);
                        $('#partName').val(data[i].partName);
                        $('#mwrapid').val(data[i].mwrapid);
                        $('#grossWeightAdd').val(data[i].grossWeightAdd);
                        $('#putinWeight').val(data[i].putinWeight);
                        $('#grossWeight').val(data[i].grossWeight);
                        $('#armNum').val(data[i].armNum);
                        $('#serialNum').val(data[i].serialNum);
                        $('#armAndserialNum').val(data[i].armAndserialNum);
                    }
                }
            }
        });
    }

    function insertProduct() {
        var packId = $("#packIdAdd").val();    // 获取id为username的<input>框数据
        // var packId = removeAllSpace($("#packIdAdd").val());    // 获取id为username的<input>框数据
        var innerDiameter = removeAllSpace($("#innerDiameterAdd").val());
        var outDiameter = removeAllSpace($("#outDiameterAdd").val());
        var outWidth = removeAllSpace($("#outWidthAdd").val());
        var stacking = removeAllSpace($("#stackingAdd").val());
        var putinQty = removeAllSpace($("#putinQtyAdd").val());
        var stackingNo = removeAllSpace($("#stackingNoAdd").val());
        var factoryProductid = removeAllSpace($("#factoryProductidAdd").val());
        var standard = removeAllSpace($("#standardAdd").val());
        var spec = removeAllSpace($("#specAdd").val());    // 获取id为password的<input>框数据
        var productTypeId = removeAllSpace($("#productTypeIdAdd").val());
        var productTypeName = removeAllSpace($("#productTypeNameAdd").val());
        var shopsign = removeAllSpace($("#shopsignAdd").val());
        var coilNo = removeAllSpace($("#coilNoAdd").val());
        var quantity = removeAllSpace($("#quantityAdd").val());
        var machineId = removeAllSpace($("#machineIdAdd").val());
        var qualityGradeName = removeAllSpace($("#qualityGradeNameAdd").val());
        var consigneeId = removeAllSpace($("#consigneeIdAdd").val());
        var consigneeName = removeAllSpace($("#consigneeNameAdd").val());
        var consigneeRemark = removeAllSpace($("#consigneeRemarkAdd").val());
        var modiDate = removeAllSpace($("#modiDateAdd").val());
        var modiTime = removeAllSpace($("#modiTimeAdd").val());
        var unitedPackid = removeAllSpace($("#unitedPackidAdd").val());
        var stoveNum = removeAllSpace($("#stoveNumAdd").val());
        var modiPerson = removeAllSpace($("#modiPersonAdd").val());
        var partId = removeAllSpace($("#partIdAdd").val());
        var partName = removeAllSpace($("#partNameAdd").val());
        var mwrapid = removeAllSpace($("#mwrapidAdd").val());
        var grossWeightAdd = removeAllSpace($("#grossWeightAddAdd").val());
        var putinWeight = removeAllSpace($("#putinWeightAdd").val());
        var grossWeight = removeAllSpace($("#grossWeightForAdd").val());
        var armNum = $("#armNumAdd").val();
        var serialNum = $("#serialNumAdd").val();
        // var armAndserialNum = removeAllSpace($("#armAndserialNumAdd").val());
        $.ajax({
            url: '/insertpartpackInfo',
            type:'post',
            contentType: "application/json;charset=utf-8",
            dataType: "json",
            data : JSON.stringify({packId:packId, innerDiameter:innerDiameter, outDiameter:outDiameter, outWidth:outWidth, stacking:stacking, putinQty:putinQty, stackingNo:stackingNo, factoryProductid:factoryProductid, standard:standard, spec:spec,
                productTypeId:productTypeId, productTypeName:productTypeName, shopsign:shopsign, coilNo:coilNo, quantity:quantity, machineId:machineId, qualityGradeName:qualityGradeName, consigneeId:consigneeId, consigneeName:consigneeName, consigneeRemark:consigneeRemark,
                modiDate:modiDate, modiTime:modiTime, unitedPackid:unitedPackid,stoveNum:stoveNum, modiPerson:modiPerson, partId:partId, partName:partName, mwrapid:mwrapid, grossWeightAdd:grossWeightAdd, putinWeight:putinWeight,
                grossWeight:grossWeight, armNum:armNum, serialNum:serialNum}),
            success:function (result) {
                console.log(result);
                if (result =="9999"){
                    /*var back = confirm('是否继续操作');
                    if(back){
                        console.log(11);
                    }else{
                        console.log(2)
                    }*/
                    alert("新增成功！");
                    location.href = "/index";
                    // window.location.reload();

                }else if(result =="1000"){
                    alert("臂号加序号重复！");
                }else {
                    alert("新增失败！");
                }
            }
        });
    }

    function updateProduct() {
        var packId = removeAllSpace($("#packId").val());    // 获取id为username的<input>框数据
        var innerDiameter = removeAllSpace($("#innerDiameter").val());
        var outDiameter = removeAllSpace($("#outDiameter").val());
        var outWidth = removeAllSpace($("#outWidth").val());
        var stacking = removeAllSpace($("#stacking").val());
        var putinQty = removeAllSpace($("#putinQty").val());
        var stackingNo = removeAllSpace($("#stackingNo").val());
        var factoryProductid = removeAllSpace($("#factoryProductid").val());
        var standard = removeAllSpace($("#standard").val());
        var spec = removeAllSpace($("#spec").val());    // 获取id为password的<input>框数据
        var productTypeId = removeAllSpace($("#productTypeId").val());
        var productTypeName = removeAllSpace($("#productTypeName").val());
        var shopsign = removeAllSpace($("#shopsign").val());
        var coilNo = removeAllSpace($("#coilNo").val());
        var quantity = removeAllSpace($("#quantity").val());
        var machineId = removeAllSpace($("#machineId").val());
        var qualityGradeName = removeAllSpace($("#qualityGradeName").val());
        var consigneeId = removeAllSpace($("#consigneeId").val());
        var consigneeName = removeAllSpace($("#consigneeName").val());
        var consigneeRemark = removeAllSpace($("#consigneeRemark").val());
        var modiDate = removeAllSpace($("#modiDate").val());
        var modiTime = removeAllSpace($("#modiTime").val());
        var unitedPackid = removeAllSpace($("#unitedPackid").val());
        var stoveNum = removeAllSpace($("#stoveNum").val());
        var modiPerson = removeAllSpace($("#modiPerson").val());
        var partId = removeAllSpace($("#partId").val());
        var partName = removeAllSpace($("#partName").val());
        var mwrapid = removeAllSpace($("#mwrapid").val());
        var grossWeightAdd = removeAllSpace($("#grossWeightAdd").val());
        var putinWeight = removeAllSpace($("#putinWeight").val());
        var grossWeight = removeAllSpace($("#grossWeight").val());
        var armNum = $("#armNum").val();
        var serialNum = $("#serialNum").val();
        // var armAndserialNum = removeAllSpace($("#armAndserialNum").val());
        <!--            {armNum},{serialNum},{armAndserialNum}-->
        $.ajax({
            url: '/updatepartpackInfo',
            type:'post',
            contentType: "application/json;charset=utf-8",
            dataType: "json",
            data : JSON.stringify({packId:packId, innerDiameter:innerDiameter, outDiameter:outDiameter, outWidth:outWidth, stacking:stacking, putinQty:putinQty, stackingNo:stackingNo, factoryProductid:factoryProductid, standard:standard, spec:spec,
                productTypeId:productTypeId, productTypeName:productTypeName, shopsign:shopsign, coilNo:coilNo, quantity:quantity, machineId:machineId, qualityGradeName:qualityGradeName, consigneeId:consigneeId, consigneeName:consigneeName, consigneeRemark:consigneeRemark,
                modiDate:modiDate, modiTime:modiTime, unitedPackid:unitedPackid,stoveNum:stoveNum, modiPerson:modiPerson, partId:partId, partName:partName, mwrapid:mwrapid, grossWeightAdd:grossWeightAdd, putinWeight:putinWeight, grossWeight:grossWeight, armNum:armNum, serialNum:serialNum}),
            success:function (result) {
                debugger;
                console.log(result);
                if (result =="9999"){
                    /*var back = confirm('是否继续操作');
                    if(back){
                        console.log(11);
                    }else{
                        console.log(2)
                    }*/
                    alert("修改成功！");
                    // location.href = "/index";
                    location.reload();
                    // window.location.reload();

                }else if(result =="1000"){
                    alert("臂号加序号重复！");
                }else {
                    alert("修改失败！");
                }
            }
        });
    }

    function removeAllSpace(str) {
        return str.replace(/\s+/g, "");
    }

</script>
</body>
</html>